import React,{Component} from 'react';

export default class oldexample extends Component {
    constructor(props){
        super(props);
        this.state={
            count:0
        };
    }
    componentDidMount(){
        document.title=`you clicked me ${this.state.count} times`
    }
    componentDidUpdate(){
        document.title = `You clicked ${ this.state.count } times`;
    }
    render(){
        return(
            <div>
                <p>You clicked {this.state.count} times</p>
                <button onClick={()=>this.setState({count:this.state.count+1})}> 
                    Click me
                </button>
            </div>
        )
    }
}